package com.ruoyi.application.service.impl;

import com.ruoyi.application.domain.Application;
import com.ruoyi.application.mapper.ApplicationMapper;
import com.ruoyi.application.service.IApplicationService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ApplicationServiceImpl implements IApplicationService {

    @Autowired
    private ApplicationMapper applicationMapper;

    /**
     * 查询申请列表
     * 使用从库查询 - 通过 Mapper 层的 @DataSource 注解实现
     * 
     * @param application 查询条件
     * @return 申请列表
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    @Transactional(readOnly = true)
    public List<Application> selectApplicationList(Application application) {
        return applicationMapper.selectApplicationList(application);
    }
} 